package cn.sofwin;

import java.sql.SQLOutput;
import java.util.Scanner;

public class Hello {
    public static void main(String[] args) {

       /*Scanner sc=new Scanner(System.in);
       System.out.println("请输入第一个整数：");
       int n1=sc.nextInt();
       System.out.println("请输入第二个整数：");
       int n2=sc.nextInt();
       int res=n1*n2;
       System.out.println(n1+"*"+n2+"="+res);*/
        Scanner sc = new Scanner(System.in);
        int t = 1;
        while (t != 0) {
            System.out.println("请选择计算器功能");
            System.out.println("1.加法运算器");
            System.out.println("2.减法运算器");
            System.out.println("3.乘法运算器");
            System.out.println("4.除法运算器");
            System.out.println("5.退出运算器");
            int c = sc.nextInt();
            System.out.println("请输入第一个整数：");
            int n1 = sc.nextInt();
            System.out.println("请输入第二个整数：");
            int n2 = sc.nextInt();
            int res;
            System.out.println("运算结果如下：");


            switch (c) {
                case 1:
                    res = n1 + n2;
                    System.out.println(n1 + "+" + n2 + "=" + res);
                    break;
                case 2:
                    res = n1 - n2;
                    System.out.println(n1 + "-" + n2 + "=" + res);
                    break;
                case 3:
                    res = n1 * n2;
                    System.out.println(n1 + "*" + n2 + "=" + res);
                    break;
                case 4:
                    res = n1 / n2;
                    System.out.println(n1 + "/" + n2 + "=" + res);
                    break;
                case 5:
                    t = 0;

            }
        }


    }
}
